// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env:'sudden-3gzfypks0b9196f8'
})
const db = cloud.database()

// 云函数入口函数
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext() 
  let money = event.money
  let leibie = event.leibie
  let time = event.time
  let info = event.info

  return await db.collection('subben_income').add({
    data:{
      money:money,
      leibie:leibie,
      time:time,
      info:info
    }
  })
}